<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="format-detection" content="telephone=no" />
<meta name="apple-touch-fullscreen" content="YES" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="MobileOptimized" content="320" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>上品生活</title>
<link href="__PUBLIC__/Catalog/css/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/Catalog/jsn/jquery1.42.min.js"></script>
</head>

<body>
<div class="top"><a href="<?php echo U('Membership/index');?>" id="back"><img src="__PUBLIC__/Catalog/nimages/tb.png"/></a>
    <p>提现管理</p>
</div>

<div class="S-user_head">
   <img src="<?php if($member['headimg'] != ''): ?>__PUBLIC__/images/memberhead/thumb/m_<?php echo ($member["headimg"]); elseif($member["headimgurl"] != ""): echo ($headimgurl); else: ?>__PUBLIC__/Catalog/nimages/touxiang.jpg<?php endif; ?>" class="user" />
   <p class="m1">会员ID：<?php echo ($member["member_id"]); ?></p>
   <p class="m2">
     <i class="S-xin_red"></i><i class="S-xin_red"></i><i class="S-xin_red"></i>
     <span>(2015)</span>
   </p>
</div>

<div class="S-user_box1">
  <ul class="kuang3">
    <li class="m1">可用：<span><?php if($moneylog['active_money'] == ''): ?>0<?php else: echo ($moneylog["active_money"]); endif; ?></span> 元</li>
    <li class="m2">冻结：<?php if($moneylog['freeze_money'] == ''): ?>0<?php else: echo ($moneylog["freeze_money"]); endif; ?> 元</li>
    <li class="m3">总额：<?php if($moneylog['account'] == ''): ?>0<?php else: echo ($moneylog["account"]); endif; ?> 元</li>
  </ul>
  <div class="S-dandukuanng">
    <form action="<?php echo U('Membership/deposit');?>" id="depositform" method="post">
   		<input type="hidden" name="member_bank_id" value="<?php echo ($bank["member_bank_id"]); ?>"/>
   		<input type="hidden" name="active_money" value="<?php if($moneylog['active_money'] == ''): ?>0<?php else: echo ($moneylog["active_money"]); endif; ?>" id="active_money"/>
    	<input type="text"  id="money" name="money" class="tx" placeholder="请输入提现金额" />
   	    <input type="button" id="tijiao"  class="sub" value="确认提现"/>
   	</form>
  </div>
</div>

<div class="S-user_box1">
    <ul class="kuang3 S-tabk">
       <li><a href="javascript:void(0);" class="cover">提现记录</a></li>
       <li><a href="javascript:void(0);">冻结记录</a></li>
       <li><a href="javascript:void(0);">资金变动记录</a></li>
    </ul>

<table class="S-table">
  <tr class="title">
    <td>提现时间</td>
    <td>金额</td>
    <td>提现状态</td>
  </tr>
   <?php if($depositlist == ''): ?><tr>
          <td colspan="3">暂无提现记录</td>
      </tr><?php endif; ?>
   <?php if(is_array($depositlist)): foreach($depositlist as $key=>$vo): ?><tr>
               <td><?php echo ($vo["withdraw_date"]); ?></td> 
               <td><?php echo ($vo["money"]); ?></td> 
               <td <?php if($vo['flag'] == 0): ?>style="color:#F00">处理中<?php elseif($vo['flag'] == 1): ?>style="color:#CCC">成功<?php else: ?> style="color:#F00">失败<?php endif; ?></td>
            </tr><?php endforeach; endif; ?>
</table>
<table class="S-table" style="display:none;">
  <tr class="title">
    <td>冻结时间</td>
    <td>金额</td>
    <td>冻结状态</td>
  </tr>
   <?php if($freeze == ''): ?><tr>
        	<td colspan="3">暂无冻结记录</td>
        </tr><?php endif; ?>
   <?php if(is_array($freeze)): foreach($freeze as $key=>$vo): ?><tr>
               <td><?php echo ($vo["moneylog_affect_date"]); ?></td> 
               <td><?php echo ($vo["affect_money"]); ?></td> 
               <td <?php if($vo['freeze_flag'] == 0): ?>style="color:#F00">冻结中<?php else: ?>style="color:#CCC;">已解冻<?php endif; ?></td>
         </tr><?php endforeach; endif; ?>
</table>
<table class="S-table" style="display:none;">
  <tr class="title">
    <td>时间</td>
    <td>变动金额</td>
    <td>说明</td>
  </tr>
  <?php if($allaccount == ''): ?><tr>
       	<td colspan="3">资金变动记录</td>
       </tr><?php endif; ?>
  <?php if(is_array($allaccount)): foreach($allaccount as $key=>$vo): ?><tr>
          <td><?php echo ($vo["moneylog_affect_date"]); ?></td> 
          <td><?php echo ($vo["affect_money"]); ?></td> 
          <td><?php echo ($vo["name"]); ?></td>
       </tr><?php endforeach; endif; ?>
</table>
<script type="text/javascript">
$(document).ready(function(e) {
    $(".S-tabk li a").click(function(){
	    $(".S-tabk li a").removeClass("cover");
		$(this).addClass("cover");
		var index = $(this).parent("li").index();
		$(".S-table").hide().eq(index).show();
	})
});

$(function(){
    if('<?php echo ($msg); ?>'!='0'){
        alert('<?php echo ($msg); ?>');
    }
});
$('#tijiao').bind('click',function(){
	var active_money=$('#active_money').val();
	var money = $('#money').val();
	if(money<100){
		alert('提现金额不能小于100元');
		return false;
	}else if(money > active_money){
		alert('提现金额不能大于账户总活动金额');
		return false;
	}else{
		$('#depositform').submit();
	}
})
</script>
</div>

 <div id="master_foot">
  	<a href="<?php echo U('Index/index');?>" class="cover"><img src="__PUBLIC__/Catalog/nimages/bottom_10.png"><span>首页</span></a>
  	<a href="<?php echo U('Products/index');?>"><img src="__PUBLIC__/Catalog/nimages/bottom_12.png"><span>商品</span></a>
  	<a href="<?php echo U('Mproducts/publish');?>"><img src="__PUBLIC__/Catalog/nimages/bottom_03.png"><span>发布</span></a>
  	<a href="<?php echo U('Membership/leaveword');?>" class="xx"><i><?php echo ($count); ?></i><img src="__PUBLIC__/Catalog/nimages/bottom_05.png"><span>信息</span></a>
  	<a href="<?php echo U('Membership/index');?>"><img src="__PUBLIC__/Catalog/nimages/bottom_07.png"><span>我的</span></a>
  </div>
</body>
</html>